package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;

/**
 * <p>
 * 鐢ㄦ埛涓庤亴浣嶅叧绯昏〃
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
@TableName("tm_user_org_position")
public class UserOrgPositionPO extends DMSBasePO<UserOrgPositionPO> {

    private static final long serialVersionUID = 1L;

    /**
     * 鐢ㄦ埛id
     */
    @TableField("USER_ID")
    private Integer userId;
    /**
     * 鑱屼綅id
     */
    @TableField("ORG_POSITION_ID")
    private Integer orgPositionId;
    @TableField("IS_DELETED")
    @Version
    private Boolean isDeleted;

    public UserOrgPositionPO() {
        super();
    }


    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getOrgPositionId() {
        return orgPositionId;
    }

    public void setOrgPositionId(Integer orgPositionId) {
        this.orgPositionId = orgPositionId;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.userId;
    }

    @Override
    public String toString() {
        return "UserOrgPositionPO{" +
        "userId=" + userId +
        ", orgPositionId=" + orgPositionId +
        ", isDeleted=" + isDeleted +
        "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "userId");
    }


}
